package com.fjw.service.impl;


import com.fjw.mapper.WarehouseMapper;
import com.fjw.pojo.Warehouse;
import com.fjw.service.WarehouseService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class WarehouseServiceImpl implements WarehouseService {

    @Autowired
    private WarehouseMapper warehouseMapper;

    @Override
    public List<Warehouse> findAll() {
        return warehouseMapper.findAll();
    }

    @Override
    public Warehouse findById(Integer id) {
        return warehouseMapper.findById(id);
    }

    @Override
    public void insert(Warehouse warehouse) {
        warehouseMapper.insert(warehouse);
    }

    @Override
    public void update(Warehouse warehouse) {
        warehouseMapper.update(warehouse);
    }

    @Override
    public void deleteById(Integer id) {
        warehouseMapper.deleteById(id);
    }

    @Override
    public void addStock(Integer id, int num) {
        warehouseMapper.addStock(id, num);
    }

    @Override
    public void reduceStock(Integer id, int num) {
        warehouseMapper.reduceStock(id, num);
    }
}